
/* start /scripts/underscore.min.js*/
(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,v=e.reduce,h=e.reduceRight,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,_=Object.keys,j=i.bind,w=function(n){return n instanceof w?n:this instanceof w?(this._wrapped=n,void 0):new w(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):n._=w,w.VERSION="1.4.3";var A=w.each=w.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a in n)if(w.has(n,a)&&t.call(e,n[a],a,n)===r)return};w.map=w.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e[e.length]=t.call(r,n,u,i)}),e)};var O="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduce===v)return e&&(t=w.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},w.reduceRight=w.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduceRight===h)return e&&(t=w.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=w.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},w.find=w.detect=function(n,t,r){var e;return E(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},w.filter=w.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&(e[e.length]=n)}),e)},w.reject=function(n,t,r){return w.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},w.every=w.all=function(n,t,e){t||(t=w.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var E=w.some=w.any=function(n,t,e){t||(t=w.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};w.contains=w.include=function(n,t){return null==n?!1:y&&n.indexOf===y?-1!=n.indexOf(t):E(n,function(n){return n===t})},w.invoke=function(n,t){var r=o.call(arguments,2);return w.map(n,function(n){return(w.isFunction(t)?t:n[t]).apply(n,r)})},w.pluck=function(n,t){return w.map(n,function(n){return n[t]})},w.where=function(n,t){return w.isEmpty(t)?[]:w.filter(n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},w.max=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.max.apply(Math,n);if(!t&&w.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>=e.computed&&(e={value:n,computed:a})}),e.value},w.min=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.min.apply(Math,n);if(!t&&w.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;e.computed>a&&(e={value:n,computed:a})}),e.value},w.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=w.random(r++),e[r-1]=e[t],e[t]=n}),e};var F=function(n){return w.isFunction(n)?n:function(t){return t[n]}};w.sortBy=function(n,t,r){var e=F(t);return w.pluck(w.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||void 0===r)return 1;if(e>r||void 0===e)return-1}return n.index<t.index?-1:1}),"value")};var k=function(n,t,r,e){var u={},i=F(t||w.identity);return A(n,function(t,a){var o=i.call(r,t,a,n);e(u,o,t)}),u};w.groupBy=function(n,t,r){return k(n,t,r,function(n,t,r){(w.has(n,t)?n[t]:n[t]=[]).push(r)})},w.countBy=function(n,t,r){return k(n,t,r,function(n,t){w.has(n,t)||(n[t]=0),n[t]++})},w.sortedIndex=function(n,t,r,e){r=null==r?w.identity:F(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;u>r.call(e,n[o])?i=o+1:a=o}return i},w.toArray=function(n){return n?w.isArray(n)?o.call(n):n.length===+n.length?w.map(n,w.identity):w.values(n):[]},w.size=function(n){return null==n?0:n.length===+n.length?n.length:w.keys(n).length},w.first=w.head=w.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},w.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},w.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},w.rest=w.tail=w.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},w.compact=function(n){return w.filter(n,w.identity)};var R=function(n,t,r){return A(n,function(n){w.isArray(n)?t?a.apply(r,n):R(n,t,r):r.push(n)}),r};w.flatten=function(n,t){return R(n,t,[])},w.without=function(n){return w.difference(n,o.call(arguments,1))},w.uniq=w.unique=function(n,t,r,e){w.isFunction(t)&&(e=r,r=t,t=!1);var u=r?w.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:w.contains(a,r))||(a.push(r),i.push(n[e]))}),i},w.union=function(){return w.uniq(c.apply(e,arguments))},w.intersection=function(n){var t=o.call(arguments,1);return w.filter(w.uniq(n),function(n){return w.every(t,function(t){return w.indexOf(t,n)>=0})})},w.difference=function(n){var t=c.apply(e,o.call(arguments,1));return w.filter(n,function(n){return!w.contains(t,n)})},w.zip=function(){for(var n=o.call(arguments),t=w.max(w.pluck(n,"length")),r=Array(t),e=0;t>e;e++)r[e]=w.pluck(n,""+e);return r},w.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},w.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=w.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},w.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},w.range=function(n,t,r){1>=arguments.length&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=Array(e);e>u;)i[u++]=n,n+=r;return i};var I=function(){};w.bind=function(n,t){var r,e;if(n.bind===j&&j)return j.apply(n,o.call(arguments,1));if(!w.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));I.prototype=n.prototype;var u=new I;I.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},w.bindAll=function(n){var t=o.call(arguments,1);return 0==t.length&&(t=w.functions(n)),A(t,function(t){n[t]=w.bind(n[t],n)}),n},w.memoize=function(n,t){var r={};return t||(t=w.identity),function(){var e=t.apply(this,arguments);return w.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},w.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},w.defer=function(n){return w.delay.apply(w,[n,1].concat(o.call(arguments,1)))},w.throttle=function(n,t){var r,e,u,i,a=0,o=function(){a=new Date,u=null,i=n.apply(r,e)};return function(){var c=new Date,l=t-(c-a);return r=this,e=arguments,0>=l?(clearTimeout(u),u=null,a=c,i=n.apply(r,e)):u||(u=setTimeout(o,l)),i}},w.debounce=function(n,t,r){var e,u;return function(){var i=this,a=arguments,o=function(){e=null,r||(u=n.apply(i,a))},c=r&&!e;return clearTimeout(e),e=setTimeout(o,t),c&&(u=n.apply(i,a)),u}},w.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},w.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},w.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},w.after=function(n,t){return 0>=n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},w.keys=_||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)w.has(n,r)&&(t[t.length]=r);return t},w.values=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push(n[r]);return t},w.pairs=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push([r,n[r]]);return t},w.invert=function(n){var t={};for(var r in n)w.has(n,r)&&(t[n[r]]=r);return t},w.functions=w.methods=function(n){var t=[];for(var r in n)w.isFunction(n[r])&&t.push(r);return t.sort()},w.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},w.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},w.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)w.contains(r,u)||(t[u]=n[u]);return t},w.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)null==n[r]&&(n[r]=t[r])}),n},w.clone=function(n){return w.isObject(n)?w.isArray(n)?n.slice():w.extend({},n):n},w.tap=function(n,t){return t(n),n};var S=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof w&&(n=n._wrapped),t instanceof w&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==t+"";case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;r.push(n),e.push(t);var a=0,o=!0;if("[object Array]"==u){if(a=n.length,o=a==t.length)for(;a--&&(o=S(n[a],t[a],r,e)););}else{var c=n.constructor,f=t.constructor;if(c!==f&&!(w.isFunction(c)&&c instanceof c&&w.isFunction(f)&&f instanceof f))return!1;for(var s in n)if(w.has(n,s)&&(a++,!(o=w.has(t,s)&&S(n[s],t[s],r,e))))break;if(o){for(s in t)if(w.has(t,s)&&!a--)break;o=!a}}return r.pop(),e.pop(),o};w.isEqual=function(n,t){return S(n,t,[],[])},w.isEmpty=function(n){if(null==n)return!0;if(w.isArray(n)||w.isString(n))return 0===n.length;for(var t in n)if(w.has(n,t))return!1;return!0},w.isElement=function(n){return!(!n||1!==n.nodeType)},w.isArray=x||function(n){return"[object Array]"==l.call(n)},w.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){w["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),w.isArguments(arguments)||(w.isArguments=function(n){return!(!n||!w.has(n,"callee"))}),w.isFunction=function(n){return"function"==typeof n},w.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},w.isNaN=function(n){return w.isNumber(n)&&n!=+n},w.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},w.isNull=function(n){return null===n},w.isUndefined=function(n){return void 0===n},w.has=function(n,t){return f.call(n,t)},w.noConflict=function(){return n._=t,this},w.identity=function(n){return n},w.times=function(n,t,r){for(var e=Array(n),u=0;n>u;u++)e[u]=t.call(r,u);return e},w.random=function(n,t){return null==t&&(t=n,n=0),n+(0|Math.random()*(t-n+1))};var T={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"}};T.unescape=w.invert(T.escape);var M={escape:RegExp("["+w.keys(T.escape).join("")+"]","g"),unescape:RegExp("("+w.keys(T.unescape).join("|")+")","g")};w.each(["escape","unescape"],function(n){w[n]=function(t){return null==t?"":(""+t).replace(M[n],function(t){return T[n][t]})}}),w.result=function(n,t){if(null==n)return null;var r=n[t];return w.isFunction(r)?r.call(n):r},w.mixin=function(n){A(w.functions(n),function(t){var r=w[t]=n[t];w.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(w,n))}})};var N=0;w.uniqueId=function(n){var t=++N+"";return n?n+t:t},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;w.template=function(n,t,r){r=w.defaults({},r,w.templateSettings);var e=RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,a,o){return i+=n.slice(u,o).replace(D,function(n){return"\\"+B[n]}),r&&(i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(i+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),a&&(i+="';\n"+a+"\n__p+='"),u=o+t.length,t}),i+="';\n",r.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var a=Function(r.variable||"obj","_",i)}catch(o){throw o.source=i,o}if(t)return a(t,w);var c=function(n){return a.call(this,n,w)};return c.source="function("+(r.variable||"obj")+"){\n"+i+"}",c},w.chain=function(n){return w(n).chain()};var z=function(n){return this._chain?w(n).chain():n};w.mixin(w),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];w.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];w.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),w.extend(w.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this);

/* end /scripts/underscore.min.js*/

/* start /scripts/shop.js*/

var itemList=[];var Shop=function(parameters){var obj=(this===window)?{}:this;obj.conf={"theme":"","pageElementId":"","gameCode":"","highlight":0,"uramRootUrl":"","productCode":"","setCurrency":"","locale":"en_US","errorMethod":"shopModal","timeout":10000,"membershipStrings":{},"callback":null};obj.template={};obj.productList={};obj.JSON;obj.attempts=0;var errors=[];function uramEntryParametersSC(){return"&theme="+obj.conf.theme+"&service="+serviceURL();};function uramEntryParametersSku(sku){return"&selectedSku="+sku+"&theme="+obj.conf.theme+"&service="+serviceURL();};obj.formatToProduct={sc:function(){var i,extraClass;for(i=0;i<obj.JSON.stationcashproducts.length;i++){(obj.JSON.stationcashproducts[i].stationCashAmount==obj.conf.highlight)?extraClass=" best-value":extraClass="";obj.productList[obj.JSON.stationcashproducts[i].stationCashAmount]={"highlight":extraClass,"itemClass":"sc-"+obj.JSON.stationcashproducts[i].stationCashAmount,"scPromo":obj.JSON.stationcashproducts[i].stationCashPromo,"pricePromo":obj.JSON.stationcashproducts[i].pricePromo,"originalAmount":obj.JSON.stationcashproducts[i].stationCashAmount,"promoAmount":obj.JSON.stationcashproducts[i].stationCashPromoAmount,"originalPrice":obj.currencyLib[obj.conf.setCurrency].parseAction(obj.JSON.stationcashproducts[i].prePromotionPrice.formattedPrice),"promoPrice":obj.currencyLib[obj.conf.setCurrency].parseAction(obj.JSON.stationcashproducts[i].price.formattedPrice)}}
obj.displaySCPricing();},kr:function(){var i,extraClass;for(i=0;i<obj.JSON.stationcashproducts.length;i++){(obj.JSON.stationcashproducts[i].stationCashAmount==5)?extraClass=" popular":extraClass="";obj.productList[obj.JSON.stationcashproducts[i].stationCashAmount]={"highlight":extraClass,"itemClass":"kr-"+obj.JSON.stationcashproducts[i].stationCashAmount,"kronoPromo":obj.JSON.stationcashproducts[i].stationCashPromo,"pricePromo":obj.JSON.stationcashproducts[i].pricePromo,"originalAmount":obj.JSON.stationcashproducts[i].stationCashAmount,"promoAmount":obj.JSON.stationcashproducts[i].stationCashPromoAmount,"originalPrice":obj.currencyLib[obj.conf.setCurrency].parseAction(obj.JSON.stationcashproducts[i].prePromotionPrice.formattedPrice),"promoPrice":obj.currencyLib[obj.conf.setCurrency].parseAction(obj.JSON.stationcashproducts[i].price.formattedPrice),"fullSku":obj.JSON.stationcashproducts[i].fullSku,"purchaseUrl":obj.productMap[obj.conf.productCode]["purchaseRequest"]+obj.conf.setCurrency+obj.productMap[obj.conf.productCode]["purchaseParameters"](obj.JSON.stationcashproducts[i].fullSku)}}
obj.displayKronoPricing();},mem:function(){var membership,extraClass,term,j,memItem;membership=obj.JSON.products[0].productoptions;for(j=0;j<membership.length;j++){var product=membership[j];(product['duration']==obj.conf.highlight)?extraClass=" best-value":extraClass="";if(product['duration']=='1'){term=obj.conf.membershipStrings.singular;}else if(product.promotional){term=obj.conf.membershipStrings.pluralSale.replace("(xxx)",obj.currencyLib[obj.conf.setCurrency].parseAction(product.originalPrice)).replace("(yyy)",product['duration']);}else{term=obj.conf.membershipStrings.plural.replace("(xxx)",product['duration']);}
obj.productList[product['duration']]={"highlight":extraClass,"duration":product.duration,"itemClass":"mem-"+product.duration,"description":(product['duration']==1)?product.duration+" "+obj.conf.membershipStrings["month"]:product.duration+" "+obj.conf.membershipStrings["months"],"billed":term,"promo":product.promotional,"originalMonthPrice":obj.currencyLib[obj.conf.setCurrency].parseAction(product.originalMonthlyPrice),"originalPrice":obj.currencyLib[obj.conf.setCurrency].parseAction(product.originalPrice),"monthPrice":obj.currencyLib[obj.conf.setCurrency].parseAction(product.monthlyPrice),"price":obj.currencyLib[obj.conf.setCurrency].parseAction(product.price),"purchaseUrl":obj.productMap[obj.conf.productCode]["purchaseRequest"]+obj.conf.setCurrency+obj.productMap[obj.conf.productCode]["purchaseParameters"](product.fullsku)}}
obj.displayMemPricing();},dlc:function(){var dlc,term,k,extraClass,slug,percentage;dlc=obj.JSON.products;for(k=0;k<dlc.length;k++){options=dlc[k]['productoptions'];if(obj.conf.trim.length>0){slug=options[0]['description'].slice(obj.conf.trim.length).toLowerCase().replace(/ /g,"-");extraClass=" "+slug;}else{extraClass="";}
if(options[0]['fullsku']==obj.conf.newItem){extraClass+=" new";}
if(options[0]['promotional']){extraClass+=" sale";var origPrice=options[0]['originalPrice'].replace(/\D/g,'');var salePrice=options[0]['price'].replace(/\D/g,'');percentage=obj.percentageSaved(origPrice,salePrice)+'%';}
obj.productList[obj.JSON.products[k]['productoptions'][0]['fullsku']]={"name":options[0]['description'],"game":slug,"sku":options[0]['fullsku'],"extraClass":extraClass,"promo":options[0]['promotional'],"originalPrice":obj.currencyLib[obj.conf.setCurrency].parseAction(options[0]['originalPrice']),"originalScPrice":options[0]['originalStationCashAmount'],"price":obj.currencyLib[obj.conf.setCurrency].parseAction(options[0]['price']),"scPrice":options[0]['stationCashAmount'],"percentage":percentage,"purchaseUrl":obj.productMap[obj.conf.productCode]["purchaseRequest"]+obj.conf.setCurrency+obj.productMap[obj.conf.productCode]["purchaseParameters"](options[0]['fullsku']),}}
obj.displayDLCPricing();},igp:function(){var ingameproduct,originalPrice,price,empire,words,l,position,save="",vs=0,tr=0,nc=0,un=0;var sortie={"no-sale":[1500,2000,2500,3000],"yes-sale":[0,250,500,1000]};ingameproduct=obj.JSON.products;for(l=0;l<ingameproduct.length;l++){empire=ingameproduct[l].sku.substring(ingameproduct[l].sku.length-2,ingameproduct[l].sku.length).toLocaleLowerCase();words=ingameproduct[l].productoptions[0].description.toLocaleLowerCase().replace("light assault","infantry").split(' ');var saleFlag="no-sale";if(ingameproduct[l].productoptions[0].promotional==true){save=obj.percentageSaved(obj.getNumber(ingameproduct[l].productoptions[0].originalPrice),obj.getNumber(ingameproduct[l].productoptions[0].price));saleFlag="yes-sale";}
if(empire=="vs"){position=sortie[saleFlag][3]+vs;vs++;}else if(empire=="tr"){position=sortie[saleFlag][2]+tr;tr++;}else if(empire=="nc"){position=sortie[saleFlag][1]+nc;nc++;}else if(empire=="un"){position=sortie[saleFlag][0]+un;un++;}
obj.productList[position]={"empire":empire,"type":words[0],"save":save,"itemClass":(words[1]=="starter")?" starter "+words[0]+" "+empire:" "+words[0]+" "+empire,"description":ingameproduct[l].productName,"marketingDescription":ingameproduct[l].productoptions[0].marketingDescription,"promo":ingameproduct[l].productoptions[0].promotional,"originalStationCashAmount":ingameproduct[l].productoptions[0].originalStationCashAmount,"originalPrice":obj.currencyLib[obj.conf.setCurrency].parseAction(ingameproduct[l].productoptions[0].originalPrice),"stationCashAmount":ingameproduct[l].productoptions[0].stationCashAmount,"price":obj.currencyLib[obj.conf.setCurrency].parseAction(ingameproduct[l].productoptions[0].price),"sku":ingameproduct[l].sku,"purchaseUrl":obj.productMap[obj.conf.productCode]["purchaseRequest"]+obj.conf.setCurrency+obj.productMap[obj.conf.productCode]["purchaseParameters"](ingameproduct[l].productoptions[0].fullsku),"purchaseSCUrl":obj.productMap[obj.conf.productCode]["purchaseRequest"]+"SOE"+obj.productMap[obj.conf.productCode]["purchaseParameters"](ingameproduct[l].productoptions[0].fullsku)}}
obj.displayIGPPricing();}};obj.productMap={"sc":{"ajaxRequest":"/rest/commerce/11/stationcashproducts.action?currency=","ajaxParameters":"","purchaseRequest":globs.urls.linkWalletFundWallet+"&currency=","purchaseParameters":uramEntryParametersSC,"dataObjectTest":"stationcashproducts"},"kr":{"ajaxRequest":"/rest/commerce/11/walletproducts.action?currency=","ajaxParameters":"","purchaseRequest":globs.urls.commerceKronosDeepEntry+"&currency=","purchaseParameters":uramEntryParametersSku,"dataObjectTest":"stationcashproducts"},"dlc":{"ajaxRequest":"/rest/commerce/11/products.action?currency=","ajaxParameters":"","purchaseRequest":globs.urls.dlcBuyDLCWithSkuAndMOPEntryPoint+"&currency=","purchaseParameters":uramEntryParametersSku,"dataObjectTest":"products"},"mem":{"ajaxRequest":"/rest/commerce/11/products.action?currency=","ajaxParameters":"","purchaseRequest":globs.urls.membershipMembershipWithSku+"&currency=","purchaseParameters":uramEntryParametersSku,"dataObjectTest":"products"},"igp":{"ajaxRequest":"/rest/commerce/11/products.action?currency=","ajaxParameters":"","purchaseRequest":globs.urls.dlcBuyDLCWithSkuAndMOPEntryPoint+"&currency=","purchaseParameters":uramEntryParametersSku,"dataObjectTest":"products"}};obj.getNumber=function(num){var number=num.replace(/[^\d\.]+/g,'');return number;};function serviceURL(){return encodeURIComponent(window.location);};function renderFront(price){return obj.currencyLib[obj.conf.setCurrency].symbol+price.replace(/[a-zA-Z$]+/g,'');};function renderRear(price){return price.replace(/[a-zA-Z]+/g,"")+obj.currencyLib[obj.conf.setCurrency].symbol;};function templatize(product){var templatizola=$('script.'+product);var templated={}
var filter=new RegExp(''+product+'\\s');templatizola.each(function(i){var tplt=templatizola[i].className.replace(filter,"");templated[tplt]=templatizola[i].text.replace(/(?!\s{1}<)[\n\t\r\s{2,}]+\</g,"<").replace(/\>[\n\t\r]+/g,">").replace(/\s{1}</g,"\u00A0<");});return templated;};function showErrors(){obj.destruct();var nonProd=/local|main|test/g;var env=window.location.toString();var res=env.match(nonProd);var message={"type":"error","text":""};if(res!==null){for(var i=0;i<errors.length;i++){window[obj.conf.errorMethod].show("The "+errors[i]["method"]+" method failed<br />"+errors[i]["message"]);message.text+="The "+errors[i]["method"]+" method failed<br />"+errors[i]["message"]+"<br />";}}else{message.text="We're sorry, pricing unavailable.<br />Please check back later.";}
window[obj.conf.errorMethod].show(message);};obj.numberSort=function(a,b){return parseInt(a)-parseInt(b);};obj.percentageSaved=function(originally,currently){return Math.floor((((parseFloat(originally)-parseFloat(currently))/parseFloat(originally))*100));};obj.currencyLib={"USD":{"symbol":"\u0024","parseAction":renderFront},"AUD":{"symbol":"A\u0024","parseAction":renderFront},"DKK":{"symbol":"kr","parseAction":renderRear},"EUR":{"symbol":"\u20AC","parseAction":renderFront},"GBP":{"symbol":"\u00A3","parseAction":renderFront},"NOK":{"symbol":"kr","parseAction":renderRear},"SEK":{"symbol":"kr","parseAction":renderRear},"CHF":{"symbol":"Fr","parseAction":renderRear},"JPY":{"symbol":"\u00A5","parseAction":renderFront},"BRL":{"symbol":"R\u0024","parseAction":renderFront}};obj.ajaxURL=function(){return obj.conf.uramRootUrl+obj.productMap[obj.conf.productCode]["ajaxRequest"]+obj.conf.setCurrency+obj.productMap[obj.conf.productCode]["ajaxParameters"];};obj.destruct=function(){$('#'+obj.conf.pageElementId).html("");obj.productList={};};obj.updateCurrency=function(cur){if(obj.currencyLib.hasOwnProperty(cur)){obj.conf.setCurrency=cur;return true;}else{return false;}};obj.updatePricing=function(){jQuery.ajax({dataType:"jsonp",type:'POST',cache:false,jsonp:"jsonp",timeout:obj.conf.timeout,url:obj.ajaxURL(),success:function(data){if(typeof data[obj.productMap[obj.conf.productCode]["dataObjectTest"]]!=='undefined'){obj.destruct();obj.JSON=data;obj.formatToProduct[obj.conf.productCode]();}else{errors.push({"method":"updatePricing","parameter":"data","message":"The AJAX data is invalid"});showErrors();}},error:function(jqXHR,textStatus,errorThrown){logToConsole("AJAX error!!!");errors.push({"method":"updatePricing","parameter":"data","message":"AJAX Error!"});if(textStatus=="parsererror"||textStatus=="timeout"){logToConsole("parser or timeout error");errors.push({"method":"updatePricing","parameter":"data","message":"parser or timeout error"});}
showErrors();}});};obj.displaySCPricing=function(){var product,tmplt,k;var $tempContainer=$("<tbody>");var items=[];for(product in obj.productList){items.push(product);}
items.sort(obj.numberSort);for(k=0;k<items.length;k++){if(obj.productList[items[k]].scPromo==true){tmplt=obj.template["sc-promo"];}else if(obj.productList[items[k]].pricePromo==true){tmplt=obj.template["currency-promo"];}else{tmplt=obj.template["base"];}
$tempContainer.append(_.template(tmplt,{item:obj.productList[items[k]]}));}
$('#'+obj.conf.pageElementId).html($tempContainer.html());if(obj.conf.callback!=null){obj.conf.callback();}};obj.displayKronoPricing=function(){var product,tmplt,k;var $tempContainer=$("<tbody>");var items=[];for(product in obj.productList){items.push(product);}
items.sort(obj.numberSort);for(k=0;k<items.length;k++){if(obj.productList[items[k]].kronoPromo==true){tmplt=obj.template["kr-promo"];}else if(obj.productList[items[k]].pricePromo==true){tmplt=obj.template["currency-promo"];}else{tmplt=obj.template["base"];}
$tempContainer.append(_.template(tmplt,{item:obj.productList[items[k]]}));}
$('#'+obj.conf.pageElementId).html($tempContainer.html());if(obj.conf.callback!=null){obj.conf.callback();}};obj.displayDLCPricing=function(){var product,tmplt,k;var $tempContainer=$("<tbody>");var items=[];for(product in obj.productList){var item_name=obj.productList[product].name.toLowerCase();items.push(product);if(item_name.indexOf('upgrade')>-1){itemList[0]=obj.productList[product];itemList[0].type='upgrade';itemList[0].shortName=dlcStrings.upgrade;}else{if(item_name.indexOf('collector')>-1){itemList[1]=obj.productList[product];itemList[1].type='collector';itemList[1].shortName=dlcStrings.collector;}else{itemList[2]=obj.productList[product];itemList[2].type='standard';itemList[2].shortName=dlcStrings.standard;}}}
items.sort(obj.numberSort);for(k=0;k<items.length;k++){tmplt=obj.template["base"];$tempContainer.append(_.template(tmplt,{item:itemList[k]}));}
$('#'+obj.conf.pageElementId).html($tempContainer.html());if(obj.conf.callback!=null){obj.conf.callback();}};obj.displayMemPricing=function(){var product,tmplt,k;var $tempContainer=$("<tbody>");var items=[];for(product in obj.productList){items.push(product);}
items.sort(obj.numberSort);for(k=0;k<items.length;k++){if(obj.productList[items[k]].promo==true){tmplt=obj.template["promo"];}else{tmplt=obj.template["base"];}
$tempContainer.append(_.template(tmplt,{item:obj.productList[items[k]]}));}
$('#'+obj.conf.pageElementId).html($tempContainer.html());if(obj.conf.callback!=null){obj.conf.callback();}};obj.displayIGPPricing=function(){var product,tmplt,k;var $tempContainer=$("<div>");var items=[];for(product in obj.productList){items.push(product);}
items.sort(obj.numberSort);for(k=0;k<items.length;k++){if(obj.productList[items[k]].promo==true){tmplt=obj.template["promo"];}else{if(obj.productList[items[k]].empire=="un"){tmplt=obj.template["alternative"];}else{tmplt=obj.template["base"];}}
$tempContainer.append(_.template(tmplt,{item:obj.productList[items[k]]}));}
$('#'+obj.conf.pageElementId).html($tempContainer.html());if(obj.conf.callback!=null){obj.conf.callback();}};obj.render=function(){if(!$("#"+parameters.pageElementId).length>0){throw new Error("The id "+parameters.pageElementId+" is not found on DOM");}
if(typeof parameters.productCode!=='undefined'){if(!obj.productMap.hasOwnProperty(parameters.productCode)){errors.push({"method":"render","parameter":parameters.productCode,"message":"productCode is not valid"});}}else{errors.push({"method":"render","parameter":"productCode","message":"productCode is undefined or null"});}
if(typeof parameters.setCurrency!=='undefined'){if(!obj.currencyLib.hasOwnProperty(parameters.setCurrency)){errors.push({"method":"render","parameter":parameters.setCurrency,"message":"currency is not valid"});}}else{errors.push({"method":"render","parameter":"currency","message":"currency is undefined or null"});}
if(typeof parameters.gameCode==='undefined'){errors.push({"method":"render","parameter":"gameCode","message":"gameCode is undefined or null"});}
if(typeof parameters.locale==='undefined'){errors.push({"method":"render","parameter":"locale","message":"locale is undefined or null"});}
if(typeof parameters.uramRootUrl==='undefined'||parameters.uramRootUrl==""){errors.push({"method":"render","parameter":"uramRootUrl","message":"uramRootUrl is undefined or empty"});}
if(!$("script."+parameters.productCode).length>0){errors.push({"method":"render","parameter":"templateInMarkup","message":"template script is undefined"});}else{obj.template=templatize(parameters.productCode);}
if(parameters.productCode=="mem"){if(typeof parameters.membershipStrings==='undefined'){errors.push({"method":"render","parameter":"membershipStrings","message":"membershipStrings is undefined"});}}
if(parameters.callback!=null){if(typeof parameters.callback!=='function'){errors.push({"method":"render","parameter":"callback","message":"callback is not a function"});}}
if(errors.length<1){$.extend(obj.conf,parameters);obj.productMap["sc"]["ajaxParameters"]="&gameCode="+obj.conf.gameCode+"&responseType=jsonp&locale="+obj.conf.locale+"&jsonp=?";obj.productMap["kr"]["ajaxParameters"]="&gameCode="+obj.conf.gameCode+"&vCurrency=KRONOS&responseType=jsonp&locale="+obj.conf.locale+"&jsonp=?";obj.productMap["dlc"]["ajaxParameters"]="&title="+obj.conf.gameCode+"&filter=DLC&responseType=jsonp&locale="+obj.conf.locale+"&jsonp=?";obj.productMap["mem"]["ajaxParameters"]="&title="+obj.conf.gameCode+"&filter=MEMBERSHIP&responseType=jsonp&locale="+obj.conf.locale+"&jsonp=?";obj.productMap["igp"]["ajaxParameters"]="&title="+obj.conf.gameCode+"&filter=INGAME_PRODUCT&responseType=jsonp&locale="+obj.conf.locale+"&jsonp=?";obj.updatePricing();}else{showErrors();}};obj.update=function(cur){if(obj.currencyLib.hasOwnProperty(cur)){obj.updateCurrency(cur);obj.updatePricing();}else{errors.push({"method":"update","parameter":cur,"message":"currency is not valid"});showErrors();}};return obj;};

/* end /scripts/shop.js*/

/* start /web-platform/scripts/libs/twitter/bootstrap.js*/

if(typeof jQuery==='undefined'){throw new Error('Bootstrap\'s JavaScript requires jQuery')}
+function($){'use strict';function transitionEnd(){var el=document.createElement('bootstrap')
var transEndEventNames={WebkitTransition:'webkitTransitionEnd',MozTransition:'transitionend',OTransition:'oTransitionEnd otransitionend',transition:'transitionend'}
for(var name in transEndEventNames){if(el.style[name]!==undefined){return{end:transEndEventNames[name]}}}
return false}
$.fn.emulateTransitionEnd=function(duration){var called=false
var $el=this
$(this).one('bsTransitionEnd',function(){called=true})
var callback=function(){if(!called)$($el).trigger($.support.transition.end)}
setTimeout(callback,duration)
return this}
$(function(){$.support.transition=transitionEnd()
if(!$.support.transition)return
$.event.special.bsTransitionEnd={bindType:$.support.transition.end,delegateType:$.support.transition.end,handle:function(e){if($(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}}})}(jQuery);+function($){'use strict';var dismiss='[data-dismiss="alert"]'
var Alert=function(el){$(el).on('click',dismiss,this.close)}
Alert.VERSION='3.2.0'
Alert.prototype.close=function(e){var $this=$(this)
var selector=$this.attr('data-target')
if(!selector){selector=$this.attr('href')
selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')}
var $parent=$(selector)
if(e)e.preventDefault()
if(!$parent.length){$parent=$this.hasClass('alert')?$this:$this.parent()}
$parent.trigger(e=$.Event('close.bs.alert'))
if(e.isDefaultPrevented())return
$parent.removeClass('in')
function removeElement(){$parent.detach().trigger('closed.bs.alert').remove()}
$.support.transition&&$parent.hasClass('fade')?$parent.one('bsTransitionEnd',removeElement).emulateTransitionEnd(150):removeElement()}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.alert')
if(!data)$this.data('bs.alert',(data=new Alert(this)))
if(typeof option=='string')data[option].call($this)})}
var old=$.fn.alert
$.fn.alert=Plugin
$.fn.alert.Constructor=Alert
$.fn.alert.noConflict=function(){$.fn.alert=old
return this}
$(document).on('click.bs.alert.data-api',dismiss,Alert.prototype.close)}(jQuery);+function($){'use strict';var Button=function(element,options){this.$element=$(element)
this.options=$.extend({},Button.DEFAULTS,options)
this.isLoading=false}
Button.VERSION='3.2.0'
Button.DEFAULTS={loadingText:'loading...'}
Button.prototype.setState=function(state){var d='disabled'
var $el=this.$element
var val=$el.is('input')?'val':'html'
var data=$el.data()
state=state+'Text'
if(data.resetText==null)$el.data('resetText',$el[val]())
$el[val](data[state]==null?this.options[state]:data[state])
setTimeout($.proxy(function(){if(state=='loadingText'){this.isLoading=true
$el.addClass(d).attr(d,d)}else if(this.isLoading){this.isLoading=false
$el.removeClass(d).removeAttr(d)}},this),0)}
Button.prototype.toggle=function(){var changed=true
var $parent=this.$element.closest('[data-toggle="buttons"]')
if($parent.length){var $input=this.$element.find('input')
if($input.prop('type')=='radio'){if($input.prop('checked')&&this.$element.hasClass('active'))changed=false
else $parent.find('.active').removeClass('active')}
if(changed)$input.prop('checked',!this.$element.hasClass('active')).trigger('change')}
if(changed)this.$element.toggleClass('active')}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.button')
var options=typeof option=='object'&&option
if(!data)$this.data('bs.button',(data=new Button(this,options)))
if(option=='toggle')data.toggle()
else if(option)data.setState(option)})}
var old=$.fn.button
$.fn.button=Plugin
$.fn.button.Constructor=Button
$.fn.button.noConflict=function(){$.fn.button=old
return this}
$(document).on('click.bs.button.data-api','[data-toggle^="button"]',function(e){var $btn=$(e.target)
if(!$btn.hasClass('btn'))$btn=$btn.closest('.btn')
Plugin.call($btn,'toggle')
e.preventDefault()})}(jQuery);+function($){'use strict';var Carousel=function(element,options){this.$element=$(element).on('keydown.bs.carousel',$.proxy(this.keydown,this))
this.$indicators=this.$element.find('.carousel-indicators')
this.options=options
this.paused=this.sliding=this.interval=this.$active=this.$items=null
this.options.pause=='hover'&&this.$element.on('mouseenter.bs.carousel',$.proxy(this.pause,this)).on('mouseleave.bs.carousel',$.proxy(this.cycle,this))}
Carousel.VERSION='3.2.0'
Carousel.DEFAULTS={interval:5000,pause:'hover',wrap:true}
Carousel.prototype.keydown=function(e){switch(e.which){case 37:this.prev();break
case 39:this.next();break
default:return}
e.preventDefault()}
Carousel.prototype.cycle=function(e){e||(this.paused=false)
this.interval&&clearInterval(this.interval)
this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval))
return this}
Carousel.prototype.getItemIndex=function(item){this.$items=item.parent().children('.item')
return this.$items.index(item||this.$active)}
Carousel.prototype.to=function(pos){var that=this
var activeIndex=this.getItemIndex(this.$active=this.$element.find('.item.active'))
if(pos>(this.$items.length-1)||pos<0)return
if(this.sliding)return this.$element.one('slid.bs.carousel',function(){that.to(pos)})
if(activeIndex==pos)return this.pause().cycle()
return this.slide(pos>activeIndex?'next':'prev',$(this.$items[pos]))}
Carousel.prototype.pause=function(e){e||(this.paused=true)
if(this.$element.find('.next, .prev').length&&$.support.transition){this.$element.trigger($.support.transition.end)
this.cycle(true)}
this.interval=clearInterval(this.interval)
return this}
Carousel.prototype.next=function(){if(this.sliding)return
return this.slide('next')}
Carousel.prototype.prev=function(){if(this.sliding)return
return this.slide('prev')}
Carousel.prototype.slide=function(type,next){var $active=this.$element.find('.item.active')
var $next=next||$active[type]()
var isCycling=this.interval
var direction=type=='next'?'left':'right'
var fallback=type=='next'?'first':'last'
var that=this
if(!$next.length){if(!this.options.wrap)return
$next=this.$element.find('.item')[fallback]()}
if($next.hasClass('active'))return(this.sliding=false)
var relatedTarget=$next[0]
var slideEvent=$.Event('slide.bs.carousel',{relatedTarget:relatedTarget,direction:direction})
this.$element.trigger(slideEvent)
if(slideEvent.isDefaultPrevented())return
this.sliding=true
isCycling&&this.pause()
if(this.$indicators.length){this.$indicators.find('.active').removeClass('active')
var $nextIndicator=$(this.$indicators.children()[this.getItemIndex($next)])
$nextIndicator&&$nextIndicator.addClass('active')}
var slidEvent=$.Event('slid.bs.carousel',{relatedTarget:relatedTarget,direction:direction})
if($.support.transition&&this.$element.hasClass('slide')){$next.addClass(type)
$next[0].offsetWidth
$active.addClass(direction)
$next.addClass(direction)
$active.one('bsTransitionEnd',function(){$next.removeClass([type,direction].join(' ')).addClass('active')
$active.removeClass(['active',direction].join(' '))
that.sliding=false
setTimeout(function(){that.$element.trigger(slidEvent)},0)}).emulateTransitionEnd($active.css('transition-duration').slice(0,-1)*1000)}else{$active.removeClass('active')
$next.addClass('active')
this.sliding=false
this.$element.trigger(slidEvent)}
isCycling&&this.cycle()
return this}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.carousel')
var options=$.extend({},Carousel.DEFAULTS,$this.data(),typeof option=='object'&&option)
var action=typeof option=='string'?option:options.slide
if(!data)$this.data('bs.carousel',(data=new Carousel(this,options)))
if(typeof option=='number')data.to(option)
else if(action)data[action]()
else if(options.interval)data.pause().cycle()})}
var old=$.fn.carousel
$.fn.carousel=Plugin
$.fn.carousel.Constructor=Carousel
$.fn.carousel.noConflict=function(){$.fn.carousel=old
return this}
$(document).on('click.bs.carousel.data-api','[data-slide], [data-slide-to]',function(e){var href
var $this=$(this)
var $target=$($this.attr('data-target')||(href=$this.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/,''))
if(!$target.hasClass('carousel'))return
var options=$.extend({},$target.data(),$this.data())
var slideIndex=$this.attr('data-slide-to')
if(slideIndex)options.interval=false
Plugin.call($target,options)
if(slideIndex){$target.data('bs.carousel').to(slideIndex)}
e.preventDefault()})
$(window).on('load',function(){$('[data-ride="carousel"]').each(function(){var $carousel=$(this)
Plugin.call($carousel,$carousel.data())})})}(jQuery);+function($){'use strict';var Collapse=function(element,options){this.$element=$(element)
this.options=$.extend({},Collapse.DEFAULTS,options)
this.transitioning=null
if(this.options.parent)this.$parent=$(this.options.parent)
if(this.options.toggle)this.toggle()}
Collapse.VERSION='3.2.0'
Collapse.DEFAULTS={toggle:true}
Collapse.prototype.dimension=function(){var hasWidth=this.$element.hasClass('width')
return hasWidth?'width':'height'}
Collapse.prototype.show=function(){if(this.transitioning||this.$element.hasClass('in'))return
var startEvent=$.Event('show.bs.collapse')
this.$element.trigger(startEvent)
if(startEvent.isDefaultPrevented())return
var actives=this.$parent&&this.$parent.find('> .panel > .in')
if(actives&&actives.length){var hasData=actives.data('bs.collapse')
if(hasData&&hasData.transitioning)return
Plugin.call(actives,'hide')
hasData||actives.data('bs.collapse',null)}
var dimension=this.dimension()
this.$element.removeClass('collapse').addClass('collapsing')[dimension](0)
this.transitioning=1
var complete=function(){this.$element.removeClass('collapsing').addClass('collapse in')[dimension]('')
this.transitioning=0
this.$element.trigger('shown.bs.collapse')}
if(!$.support.transition)return complete.call(this)
var scrollSize=$.camelCase(['scroll',dimension].join('-'))
this.$element.one('bsTransitionEnd',$.proxy(complete,this)).emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize])}
Collapse.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass('in'))return
var startEvent=$.Event('hide.bs.collapse')
this.$element.trigger(startEvent)
if(startEvent.isDefaultPrevented())return
var dimension=this.dimension()
this.$element[dimension](this.$element[dimension]())[0].offsetHeight
this.$element.addClass('collapsing').removeClass('collapse').removeClass('in')
this.transitioning=1
var complete=function(){this.transitioning=0
this.$element.trigger('hidden.bs.collapse').removeClass('collapsing').addClass('collapse')}
if(!$.support.transition)return complete.call(this)
this.$element
[dimension](0).one('bsTransitionEnd',$.proxy(complete,this)).emulateTransitionEnd(350)}
Collapse.prototype.toggle=function(){this[this.$element.hasClass('in')?'hide':'show']()}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.collapse')
var options=$.extend({},Collapse.DEFAULTS,$this.data(),typeof option=='object'&&option)
if(!data&&options.toggle&&option=='show')option=!option
if(!data)$this.data('bs.collapse',(data=new Collapse(this,options)))
if(typeof option=='string')data[option]()})}
var old=$.fn.collapse
$.fn.collapse=Plugin
$.fn.collapse.Constructor=Collapse
$.fn.collapse.noConflict=function(){$.fn.collapse=old
return this}
$(document).on('click.bs.collapse.data-api','[data-toggle="collapse"]',function(e){var href
var $this=$(this)
var target=$this.attr('data-target')||e.preventDefault()||(href=$this.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/,'')
var $target=$(target)
var data=$target.data('bs.collapse')
var option=data?'toggle':$this.data()
var parent=$this.attr('data-parent')
var $parent=parent&&$(parent)
if(!data||!data.transitioning){if($parent)$parent.find('[data-toggle="collapse"][data-parent="'+parent+'"]').not($this).addClass('collapsed')
$this[$target.hasClass('in')?'addClass':'removeClass']('collapsed')}
Plugin.call($target,option)})}(jQuery);+function($){'use strict';var backdrop='.dropdown-backdrop'
var toggle='[data-toggle="dropdown"]'
var Dropdown=function(element){$(element).on('click.bs.dropdown',this.toggle)}
Dropdown.VERSION='3.2.0'
Dropdown.prototype.toggle=function(e){var $this=$(this)
if($this.is('.disabled, :disabled'))return
var $parent=getParent($this)
var isActive=$parent.hasClass('open')
clearMenus()
if(!isActive){if('ontouchstart'in document.documentElement&&!$parent.closest('.navbar-nav').length){$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click',clearMenus)}
var relatedTarget={relatedTarget:this}
$parent.trigger(e=$.Event('show.bs.dropdown',relatedTarget))
if(e.isDefaultPrevented())return
$this.trigger('focus')
$parent.toggleClass('open').trigger('shown.bs.dropdown',relatedTarget)}
return false}
Dropdown.prototype.keydown=function(e){if(!/(38|40|27)/.test(e.keyCode))return
var $this=$(this)
e.preventDefault()
e.stopPropagation()
if($this.is('.disabled, :disabled'))return
var $parent=getParent($this)
var isActive=$parent.hasClass('open')
if(!isActive||(isActive&&e.keyCode==27)){if(e.which==27)$parent.find(toggle).trigger('focus')
return $this.trigger('click')}
var desc=' li:not(.divider):visible a'
var $items=$parent.find('[role="menu"]'+desc+', [role="listbox"]'+desc)
if(!$items.length)return
var index=$items.index($items.filter(':focus'))
if(e.keyCode==38&&index>0)index--
if(e.keyCode==40&&index<$items.length-1)index++
if(!~index)index=0
$items.eq(index).trigger('focus')}
function clearMenus(e){if(e&&e.which===3)return
$(backdrop).remove()
$(toggle).each(function(){var $parent=getParent($(this))
var relatedTarget={relatedTarget:this}
if(!$parent.hasClass('open'))return
$parent.trigger(e=$.Event('hide.bs.dropdown',relatedTarget))
if(e.isDefaultPrevented())return
$parent.removeClass('open').trigger('hidden.bs.dropdown',relatedTarget)})}
function getParent($this){var selector=$this.attr('data-target')
if(!selector){selector=$this.attr('href')
selector=selector&&/#[A-Za-z]/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,'')}
var $parent=selector&&$(selector)
return $parent&&$parent.length?$parent:$this.parent()}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.dropdown')
if(!data)$this.data('bs.dropdown',(data=new Dropdown(this)))
if(typeof option=='string')data[option].call($this)})}
var old=$.fn.dropdown
$.fn.dropdown=Plugin
$.fn.dropdown.Constructor=Dropdown
$.fn.dropdown.noConflict=function(){$.fn.dropdown=old
return this}
$(document).on('click.bs.dropdown.data-api',clearMenus).on('click.bs.dropdown.data-api','.dropdown form',function(e){e.stopPropagation()}).on('click.bs.dropdown.data-api',toggle,Dropdown.prototype.toggle).on('keydown.bs.dropdown.data-api',toggle+', [role="menu"], [role="listbox"]',Dropdown.prototype.keydown)}(jQuery);+function($){'use strict';var Modal=function(element,options){this.options=options
this.$body=$(document.body)
this.$element=$(element)
this.$backdrop=this.isShown=null
this.scrollbarWidth=0
if(this.options.remote){this.$element.find('.modal-content').load(this.options.remote,$.proxy(function(){this.$element.trigger('loaded.bs.modal')},this))}}
Modal.VERSION='3.2.0'
Modal.DEFAULTS={backdrop:true,keyboard:true,show:true}
Modal.prototype.toggle=function(_relatedTarget){return this.isShown?this.hide():this.show(_relatedTarget)}
Modal.prototype.show=function(_relatedTarget){var that=this
var e=$.Event('show.bs.modal',{relatedTarget:_relatedTarget})
this.$element.trigger(e)
if(this.isShown||e.isDefaultPrevented())return
this.isShown=true
this.checkScrollbar()
this.$body.addClass('modal-open')
this.setScrollbar()
this.escape()
this.$element.on('click.dismiss.bs.modal','[data-dismiss="modal"]',$.proxy(this.hide,this))
this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass('fade')
if(!that.$element.parent().length){that.$element.appendTo(that.$body)}
that.$element.show().scrollTop(0)
if(transition){that.$element[0].offsetWidth}
that.$element.addClass('in').attr('aria-hidden',false)
that.enforceFocus()
var e=$.Event('shown.bs.modal',{relatedTarget:_relatedTarget})
transition?that.$element.find('.modal-dialog').one('bsTransitionEnd',function(){that.$element.trigger('focus').trigger(e)}).emulateTransitionEnd(300):that.$element.trigger('focus').trigger(e)})}
Modal.prototype.hide=function(e){if(e)e.preventDefault()
e=$.Event('hide.bs.modal')
this.$element.trigger(e)
if(!this.isShown||e.isDefaultPrevented())return
this.isShown=false
this.$body.removeClass('modal-open')
this.resetScrollbar()
this.escape()
$(document).off('focusin.bs.modal')
this.$element.removeClass('in').attr('aria-hidden',true).off('click.dismiss.bs.modal')
$.support.transition&&this.$element.hasClass('fade')?this.$element.one('bsTransitionEnd',$.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()}
Modal.prototype.enforceFocus=function(){$(document).off('focusin.bs.modal').on('focusin.bs.modal',$.proxy(function(e){if(this.$element[0]!==e.target&&!this.$element.has(e.target).length){this.$element.trigger('focus')}},this))}
Modal.prototype.escape=function(){if(this.isShown&&this.options.keyboard){this.$element.on('keyup.dismiss.bs.modal',$.proxy(function(e){e.which==27&&this.hide()},this))}else if(!this.isShown){this.$element.off('keyup.dismiss.bs.modal')}}
Modal.prototype.hideModal=function(){var that=this
this.$element.hide()
this.backdrop(function(){that.$element.trigger('hidden.bs.modal')})}
Modal.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove()
this.$backdrop=null}
Modal.prototype.backdrop=function(callback){var that=this
var animate=this.$element.hasClass('fade')?'fade':''
if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate
this.$backdrop=$('<div class="modal-backdrop '+animate+'" />').appendTo(this.$body)
this.$element.on('click.dismiss.bs.modal',$.proxy(function(e){if(e.target!==e.currentTarget)return
this.options.backdrop=='static'?this.$element[0].focus.call(this.$element[0]):this.hide.call(this)},this))
if(doAnimate)this.$backdrop[0].offsetWidth
this.$backdrop.addClass('in')
if(!callback)return
doAnimate?this.$backdrop.one('bsTransitionEnd',callback).emulateTransitionEnd(150):callback()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass('in')
var callbackRemove=function(){that.removeBackdrop()
callback&&callback()}
$.support.transition&&this.$element.hasClass('fade')?this.$backdrop.one('bsTransitionEnd',callbackRemove).emulateTransitionEnd(150):callbackRemove()}else if(callback){callback()}}
Modal.prototype.checkScrollbar=function(){if(document.body.clientWidth>=window.innerWidth)return
this.scrollbarWidth=this.scrollbarWidth||this.measureScrollbar()}
Modal.prototype.setScrollbar=function(){var bodyPad=parseInt((this.$body.css('padding-right')||0),10)
if(this.scrollbarWidth)this.$body.css('padding-right',bodyPad+this.scrollbarWidth)}
Modal.prototype.resetScrollbar=function(){this.$body.css('padding-right','')}
Modal.prototype.measureScrollbar=function(){var scrollDiv=document.createElement('div')
scrollDiv.className='modal-scrollbar-measure'
this.$body.append(scrollDiv)
var scrollbarWidth=scrollDiv.offsetWidth-scrollDiv.clientWidth
this.$body[0].removeChild(scrollDiv)
return scrollbarWidth}
function Plugin(option,_relatedTarget){return this.each(function(){var $this=$(this)
var data=$this.data('bs.modal')
var options=$.extend({},Modal.DEFAULTS,$this.data(),typeof option=='object'&&option)
if(!data)$this.data('bs.modal',(data=new Modal(this,options)))
if(typeof option=='string')data[option](_relatedTarget)
else if(options.show)data.show(_relatedTarget)})}
var old=$.fn.modal
$.fn.modal=Plugin
$.fn.modal.Constructor=Modal
$.fn.modal.noConflict=function(){$.fn.modal=old
return this}
$(document).on('click.bs.modal.data-api','[data-toggle="modal"]',function(e){var $this=$(this)
var href=$this.attr('href')
var $target=$($this.attr('data-target')||(href&&href.replace(/.*(?=#[^\s]+$)/,'')))
var option=$target.data('bs.modal')?'toggle':$.extend({remote:!/#/.test(href)&&href},$target.data(),$this.data())
if($this.is('a'))e.preventDefault()
$target.one('show.bs.modal',function(showEvent){if(showEvent.isDefaultPrevented())return
$target.one('hidden.bs.modal',function(){$this.is(':visible')&&$this.trigger('focus')})})
Plugin.call($target,option,this)})}(jQuery);+function($){'use strict';var Tooltip=function(element,options){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null
this.init('tooltip',element,options)}
Tooltip.VERSION='3.2.0'
Tooltip.DEFAULTS={animation:true,placement:'top',selector:false,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:'hover focus',title:'',delay:0,html:false,container:false,viewport:{selector:'body',padding:0}}
Tooltip.prototype.init=function(type,element,options){this.enabled=true
this.type=type
this.$element=$(element)
this.options=this.getOptions(options)
this.$viewport=this.options.viewport&&$(this.options.viewport.selector||this.options.viewport)
var triggers=this.options.trigger.split(' ')
for(var i=triggers.length;i--;){var trigger=triggers[i]
if(trigger=='click'){this.$element.on('click.'+this.type,this.options.selector,$.proxy(this.toggle,this))}else if(trigger!='manual'){var eventIn=trigger=='hover'?'mouseenter':'focusin'
var eventOut=trigger=='hover'?'mouseleave':'focusout'
this.$element.on(eventIn+'.'+this.type,this.options.selector,$.proxy(this.enter,this))
this.$element.on(eventOut+'.'+this.type,this.options.selector,$.proxy(this.leave,this))}}
this.options.selector?(this._options=$.extend({},this.options,{trigger:'manual',selector:''})):this.fixTitle()}
Tooltip.prototype.getDefaults=function(){return Tooltip.DEFAULTS}
Tooltip.prototype.getOptions=function(options){options=$.extend({},this.getDefaults(),this.$element.data(),options)
if(options.delay&&typeof options.delay=='number'){options.delay={show:options.delay,hide:options.delay}}
return options}
Tooltip.prototype.getDelegateOptions=function(){var options={}
var defaults=this.getDefaults()
this._options&&$.each(this._options,function(key,value){if(defaults[key]!=value)options[key]=value})
return options}
Tooltip.prototype.enter=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget).data('bs.'+this.type)
if(!self){self=new this.constructor(obj.currentTarget,this.getDelegateOptions())
$(obj.currentTarget).data('bs.'+this.type,self)}
clearTimeout(self.timeout)
self.hoverState='in'
if(!self.options.delay||!self.options.delay.show)return self.show()
self.timeout=setTimeout(function(){if(self.hoverState=='in')self.show()},self.options.delay.show)}
Tooltip.prototype.leave=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget).data('bs.'+this.type)
if(!self){self=new this.constructor(obj.currentTarget,this.getDelegateOptions())
$(obj.currentTarget).data('bs.'+this.type,self)}
clearTimeout(self.timeout)
self.hoverState='out'
if(!self.options.delay||!self.options.delay.hide)return self.hide()
self.timeout=setTimeout(function(){if(self.hoverState=='out')self.hide()},self.options.delay.hide)}
Tooltip.prototype.show=function(){var e=$.Event('show.bs.'+this.type)
if(this.hasContent()&&this.enabled){this.$element.trigger(e)
var inDom=$.contains(document.documentElement,this.$element[0])
if(e.isDefaultPrevented()||!inDom)return
var that=this
var $tip=this.tip()
var tipId=this.getUID(this.type)
this.setContent()
$tip.attr('id',tipId)
this.$element.attr('aria-describedby',tipId)
if(this.options.animation)$tip.addClass('fade')
var placement=typeof this.options.placement=='function'?this.options.placement.call(this,$tip[0],this.$element[0]):this.options.placement
var autoToken=/\s?auto?\s?/i
var autoPlace=autoToken.test(placement)
if(autoPlace)placement=placement.replace(autoToken,'')||'top'
$tip.detach().css({top:0,left:0,display:'block'}).addClass(placement).data('bs.'+this.type,this)
this.options.container?$tip.appendTo(this.options.container):$tip.insertAfter(this.$element)
var pos=this.getPosition()
var actualWidth=$tip[0].offsetWidth
var actualHeight=$tip[0].offsetHeight
if(autoPlace){var orgPlacement=placement
var $parent=this.$element.parent()
var parentDim=this.getPosition($parent)
placement=placement=='bottom'&&pos.top+pos.height+actualHeight-parentDim.scroll>parentDim.height?'top':placement=='top'&&pos.top-parentDim.scroll-actualHeight<0?'bottom':placement=='right'&&pos.right+actualWidth>parentDim.width?'left':placement=='left'&&pos.left-actualWidth<parentDim.left?'right':placement
$tip.removeClass(orgPlacement).addClass(placement)}
var calculatedOffset=this.getCalculatedOffset(placement,pos,actualWidth,actualHeight)
this.applyPlacement(calculatedOffset,placement)
var complete=function(){that.$element.trigger('shown.bs.'+that.type)
that.hoverState=null}
$.support.transition&&this.$tip.hasClass('fade')?$tip.one('bsTransitionEnd',complete).emulateTransitionEnd(150):complete()}}
Tooltip.prototype.applyPlacement=function(offset,placement){var $tip=this.tip()
var width=$tip[0].offsetWidth
var height=$tip[0].offsetHeight
var marginTop=parseInt($tip.css('margin-top'),10)
var marginLeft=parseInt($tip.css('margin-left'),10)
if(isNaN(marginTop))marginTop=0
if(isNaN(marginLeft))marginLeft=0
offset.top=offset.top+marginTop
offset.left=offset.left+marginLeft
$.offset.setOffset($tip[0],$.extend({using:function(props){$tip.css({top:Math.round(props.top),left:Math.round(props.left)})}},offset),0)
$tip.addClass('in')
var actualWidth=$tip[0].offsetWidth
var actualHeight=$tip[0].offsetHeight
if(placement=='top'&&actualHeight!=height){offset.top=offset.top+height-actualHeight}
var delta=this.getViewportAdjustedDelta(placement,offset,actualWidth,actualHeight)
if(delta.left)offset.left+=delta.left
else offset.top+=delta.top
var arrowDelta=delta.left?delta.left*2-width+actualWidth:delta.top*2-height+actualHeight
var arrowPosition=delta.left?'left':'top'
var arrowOffsetPosition=delta.left?'offsetWidth':'offsetHeight'
$tip.offset(offset)
this.replaceArrow(arrowDelta,$tip[0][arrowOffsetPosition],arrowPosition)}
Tooltip.prototype.replaceArrow=function(delta,dimension,position){this.arrow().css(position,delta?(50*(1-delta/dimension)+'%'):'')}
Tooltip.prototype.setContent=function(){var $tip=this.tip()
var title=this.getTitle()
$tip.find('.tooltip-inner')[this.options.html?'html':'text'](title)
$tip.removeClass('fade in top bottom left right')}
Tooltip.prototype.hide=function(){var that=this
var $tip=this.tip()
var e=$.Event('hide.bs.'+this.type)
this.$element.removeAttr('aria-describedby')
function complete(){if(that.hoverState!='in')$tip.detach()
that.$element.trigger('hidden.bs.'+that.type)}
this.$element.trigger(e)
if(e.isDefaultPrevented())return
$tip.removeClass('in')
$.support.transition&&this.$tip.hasClass('fade')?$tip.one('bsTransitionEnd',complete).emulateTransitionEnd(150):complete()
this.hoverState=null
return this}
Tooltip.prototype.fixTitle=function(){var $e=this.$element
if($e.attr('title')||typeof($e.attr('data-original-title'))!='string'){$e.attr('data-original-title',$e.attr('title')||'').attr('title','')}}
Tooltip.prototype.hasContent=function(){return this.getTitle()}
Tooltip.prototype.getPosition=function($element){$element=$element||this.$element
var el=$element[0]
var isBody=el.tagName=='BODY'
return $.extend({},(typeof el.getBoundingClientRect=='function')?el.getBoundingClientRect():null,{scroll:isBody?document.documentElement.scrollTop||document.body.scrollTop:$element.scrollTop(),width:isBody?$(window).width():$element.outerWidth(),height:isBody?$(window).height():$element.outerHeight()},isBody?{top:0,left:0}:$element.offset())}
Tooltip.prototype.getCalculatedOffset=function(placement,pos,actualWidth,actualHeight){return placement=='bottom'?{top:pos.top+pos.height,left:pos.left+pos.width/2-actualWidth/2}:placement=='top'?{top:pos.top-actualHeight,left:pos.left+pos.width/2-actualWidth/2}:placement=='left'?{top:pos.top+pos.height/2-actualHeight/2,left:pos.left-actualWidth}:{top:pos.top+pos.height/2-actualHeight/2,left:pos.left+pos.width}}
Tooltip.prototype.getViewportAdjustedDelta=function(placement,pos,actualWidth,actualHeight){var delta={top:0,left:0}
if(!this.$viewport)return delta
var viewportPadding=this.options.viewport&&this.options.viewport.padding||0
var viewportDimensions=this.getPosition(this.$viewport)
if(/right|left/.test(placement)){var topEdgeOffset=pos.top-viewportPadding-viewportDimensions.scroll
var bottomEdgeOffset=pos.top+viewportPadding-viewportDimensions.scroll+actualHeight
if(topEdgeOffset<viewportDimensions.top){delta.top=viewportDimensions.top-topEdgeOffset}else if(bottomEdgeOffset>viewportDimensions.top+viewportDimensions.height){delta.top=viewportDimensions.top+viewportDimensions.height-bottomEdgeOffset}}else{var leftEdgeOffset=pos.left-viewportPadding
var rightEdgeOffset=pos.left+viewportPadding+actualWidth
if(leftEdgeOffset<viewportDimensions.left){delta.left=viewportDimensions.left-leftEdgeOffset}else if(rightEdgeOffset>viewportDimensions.width){delta.left=viewportDimensions.left+viewportDimensions.width-rightEdgeOffset}}
return delta}
Tooltip.prototype.getTitle=function(){var title
var $e=this.$element
var o=this.options
title=$e.attr('data-original-title')||(typeof o.title=='function'?o.title.call($e[0]):o.title)
return title}
Tooltip.prototype.getUID=function(prefix){do prefix+=~~(Math.random()*1000000)
while(document.getElementById(prefix))
return prefix}
Tooltip.prototype.tip=function(){return(this.$tip=this.$tip||$(this.options.template))}
Tooltip.prototype.arrow=function(){return(this.$arrow=this.$arrow||this.tip().find('.tooltip-arrow'))}
Tooltip.prototype.validate=function(){if(!this.$element[0].parentNode){this.hide()
this.$element=null
this.options=null}}
Tooltip.prototype.enable=function(){this.enabled=true}
Tooltip.prototype.disable=function(){this.enabled=false}
Tooltip.prototype.toggleEnabled=function(){this.enabled=!this.enabled}
Tooltip.prototype.toggle=function(e){var self=this
if(e){self=$(e.currentTarget).data('bs.'+this.type)
if(!self){self=new this.constructor(e.currentTarget,this.getDelegateOptions())
$(e.currentTarget).data('bs.'+this.type,self)}}
self.tip().hasClass('in')?self.leave(self):self.enter(self)}
Tooltip.prototype.destroy=function(){clearTimeout(this.timeout)
this.hide().$element.off('.'+this.type).removeData('bs.'+this.type)}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.tooltip')
var options=typeof option=='object'&&option
if(!data&&option=='destroy')return
if(!data)$this.data('bs.tooltip',(data=new Tooltip(this,options)))
if(typeof option=='string')data[option]()})}
var old=$.fn.tooltip
$.fn.tooltip=Plugin
$.fn.tooltip.Constructor=Tooltip
$.fn.tooltip.noConflict=function(){$.fn.tooltip=old
return this}}(jQuery);+function($){'use strict';var Popover=function(element,options){this.init('popover',element,options)}
if(!$.fn.tooltip)throw new Error('Popover requires tooltip.js')
Popover.VERSION='3.2.0'
Popover.DEFAULTS=$.extend({},$.fn.tooltip.Constructor.DEFAULTS,{placement:'right',trigger:'click',content:'',template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'})
Popover.prototype=$.extend({},$.fn.tooltip.Constructor.prototype)
Popover.prototype.constructor=Popover
Popover.prototype.getDefaults=function(){return Popover.DEFAULTS}
Popover.prototype.setContent=function(){var $tip=this.tip()
var title=this.getTitle()
var content=this.getContent()
$tip.find('.popover-title')[this.options.html?'html':'text'](title)
$tip.find('.popover-content').empty()[this.options.html?(typeof content=='string'?'html':'append'):'text'](content)
$tip.removeClass('fade top bottom left right in')
if(!$tip.find('.popover-title').html())$tip.find('.popover-title').hide()}
Popover.prototype.hasContent=function(){return this.getTitle()||this.getContent()}
Popover.prototype.getContent=function(){var $e=this.$element
var o=this.options
return $e.attr('data-content')||(typeof o.content=='function'?o.content.call($e[0]):o.content)}
Popover.prototype.arrow=function(){return(this.$arrow=this.$arrow||this.tip().find('.arrow'))}
Popover.prototype.tip=function(){if(!this.$tip)this.$tip=$(this.options.template)
return this.$tip}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.popover')
var options=typeof option=='object'&&option
if(!data&&option=='destroy')return
if(!data)$this.data('bs.popover',(data=new Popover(this,options)))
if(typeof option=='string')data[option]()})}
var old=$.fn.popover
$.fn.popover=Plugin
$.fn.popover.Constructor=Popover
$.fn.popover.noConflict=function(){$.fn.popover=old
return this}}(jQuery);+function($){'use strict';function ScrollSpy(element,options){var process=$.proxy(this.process,this)
this.$body=$('body')
this.$scrollElement=$(element).is('body')?$(window):$(element)
this.options=$.extend({},ScrollSpy.DEFAULTS,options)
this.selector=(this.options.target||'')+' .nav li > a'
this.offsets=[]
this.targets=[]
this.activeTarget=null
this.scrollHeight=0
this.$scrollElement.on('scroll.bs.scrollspy',process)
this.refresh()
this.process()}
ScrollSpy.VERSION='3.2.0'
ScrollSpy.DEFAULTS={offset:10}
ScrollSpy.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)}
ScrollSpy.prototype.refresh=function(){var offsetMethod='offset'
var offsetBase=0
if(!$.isWindow(this.$scrollElement[0])){offsetMethod='position'
offsetBase=this.$scrollElement.scrollTop()}
this.offsets=[]
this.targets=[]
this.scrollHeight=this.getScrollHeight()
var self=this
this.$body.find(this.selector).map(function(){var $el=$(this)
var href=$el.data('target')||$el.attr('href')
var $href=/^#./.test(href)&&$(href)
return($href&&$href.length&&$href.is(':visible')&&[[$href[offsetMethod]().top+offsetBase,href]])||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){self.offsets.push(this[0])
self.targets.push(this[1])})}
ScrollSpy.prototype.process=function(){var scrollTop=this.$scrollElement.scrollTop()+this.options.offset
var scrollHeight=this.getScrollHeight()
var maxScroll=this.options.offset+scrollHeight-this.$scrollElement.height()
var offsets=this.offsets
var targets=this.targets
var activeTarget=this.activeTarget
var i
if(this.scrollHeight!=scrollHeight){this.refresh()}
if(scrollTop>=maxScroll){return activeTarget!=(i=targets[targets.length-1])&&this.activate(i)}
if(activeTarget&&scrollTop<=offsets[0]){return activeTarget!=(i=targets[0])&&this.activate(i)}
for(i=offsets.length;i--;){activeTarget!=targets[i]&&scrollTop>=offsets[i]&&(!offsets[i+1]||scrollTop<=offsets[i+1])&&this.activate(targets[i])}}
ScrollSpy.prototype.activate=function(target){this.activeTarget=target
$(this.selector).parentsUntil(this.options.target,'.active').removeClass('active')
var selector=this.selector+'[data-target="'+target+'"],'+
this.selector+'[href="'+target+'"]'
var active=$(selector).parents('li').addClass('active')
if(active.parent('.dropdown-menu').length){active=active.closest('li.dropdown').addClass('active')}
active.trigger('activate.bs.scrollspy')}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.scrollspy')
var options=typeof option=='object'&&option
if(!data)$this.data('bs.scrollspy',(data=new ScrollSpy(this,options)))
if(typeof option=='string')data[option]()})}
var old=$.fn.scrollspy
$.fn.scrollspy=Plugin
$.fn.scrollspy.Constructor=ScrollSpy
$.fn.scrollspy.noConflict=function(){$.fn.scrollspy=old
return this}
$(window).on('load.bs.scrollspy.data-api',function(){$('[data-spy="scroll"]').each(function(){var $spy=$(this)
Plugin.call($spy,$spy.data())})})}(jQuery);+function($){'use strict';var Tab=function(element){this.element=$(element)}
Tab.VERSION='3.2.0'
Tab.prototype.show=function(){var $this=this.element
var $ul=$this.closest('ul:not(.dropdown-menu)')
var selector=$this.data('target')
if(!selector){selector=$this.attr('href')
selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')}
if($this.parent('li').hasClass('active'))return
var previous=$ul.find('.active:last a')[0]
var e=$.Event('show.bs.tab',{relatedTarget:previous})
$this.trigger(e)
if(e.isDefaultPrevented())return
var $target=$(selector)
this.activate($this.closest('li'),$ul)
this.activate($target,$target.parent(),function(){$this.trigger({type:'shown.bs.tab',relatedTarget:previous})})}
Tab.prototype.activate=function(element,container,callback){var $active=container.find('> .active')
var transition=callback&&$.support.transition&&$active.hasClass('fade')
function next(){$active.removeClass('active').find('> .dropdown-menu > .active').removeClass('active')
element.addClass('active')
if(transition){element[0].offsetWidth
element.addClass('in')}else{element.removeClass('fade')}
if(element.parent('.dropdown-menu')){element.closest('li.dropdown').addClass('active')}
callback&&callback()}
transition?$active.one('bsTransitionEnd',next).emulateTransitionEnd(150):next()
$active.removeClass('in')}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.tab')
if(!data)$this.data('bs.tab',(data=new Tab(this)))
if(typeof option=='string')data[option]()})}
var old=$.fn.tab
$.fn.tab=Plugin
$.fn.tab.Constructor=Tab
$.fn.tab.noConflict=function(){$.fn.tab=old
return this}
$(document).on('click.bs.tab.data-api','[data-toggle="tab"], [data-toggle="pill"]',function(e){e.preventDefault()
Plugin.call($(this),'show')})}(jQuery);+function($){'use strict';var Affix=function(element,options){this.options=$.extend({},Affix.DEFAULTS,options)
this.$target=$(this.options.target).on('scroll.bs.affix.data-api',$.proxy(this.checkPosition,this)).on('click.bs.affix.data-api',$.proxy(this.checkPositionWithEventLoop,this))
this.$element=$(element)
this.affixed=this.unpin=this.pinnedOffset=null
this.checkPosition()}
Affix.VERSION='3.2.0'
Affix.RESET='affix affix-top affix-bottom'
Affix.DEFAULTS={offset:0,target:window}
Affix.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset
this.$element.removeClass(Affix.RESET).addClass('affix')
var scrollTop=this.$target.scrollTop()
var position=this.$element.offset()
return(this.pinnedOffset=position.top-scrollTop)}
Affix.prototype.checkPositionWithEventLoop=function(){setTimeout($.proxy(this.checkPosition,this),1)}
Affix.prototype.checkPosition=function(){if(!this.$element.is(':visible'))return
var scrollHeight=$(document).height()
var scrollTop=this.$target.scrollTop()
var position=this.$element.offset()
var offset=this.options.offset
var offsetTop=offset.top
var offsetBottom=offset.bottom
if(typeof offset!='object')offsetBottom=offsetTop=offset
if(typeof offsetTop=='function')offsetTop=offset.top(this.$element)
if(typeof offsetBottom=='function')offsetBottom=offset.bottom(this.$element)
var affix=this.unpin!=null&&(scrollTop+this.unpin<=position.top)?false:offsetBottom!=null&&(position.top+this.$element.height()>=scrollHeight-offsetBottom)?'bottom':offsetTop!=null&&(scrollTop<=offsetTop)?'top':false
if(this.affixed===affix)return
if(this.unpin!=null)this.$element.css('top','')
var affixType='affix'+(affix?'-'+affix:'')
var e=$.Event(affixType+'.bs.affix')
this.$element.trigger(e)
if(e.isDefaultPrevented())return
this.affixed=affix
this.unpin=affix=='bottom'?this.getPinnedOffset():null
this.$element.removeClass(Affix.RESET).addClass(affixType).trigger($.Event(affixType.replace('affix','affixed')))
if(affix=='bottom'){this.$element.offset({top:scrollHeight-this.$element.height()-offsetBottom})}}
function Plugin(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.affix')
var options=typeof option=='object'&&option
if(!data)$this.data('bs.affix',(data=new Affix(this,options)))
if(typeof option=='string')data[option]()})}
var old=$.fn.affix
$.fn.affix=Plugin
$.fn.affix.Constructor=Affix
$.fn.affix.noConflict=function(){$.fn.affix=old
return this}
$(window).on('load',function(){$('[data-spy="affix"]').each(function(){var $spy=$(this)
var data=$spy.data()
data.offset=data.offset||{}
if(data.offsetBottom)data.offset.bottom=data.offsetBottom
if(data.offsetTop)data.offset.top=data.offsetTop
Plugin.call($spy,data)})})}(jQuery);

/* end /web-platform/scripts/libs/twitter/bootstrap.js*/

/* start /web-platform/scripts/web-platform/component/media-modal.js*/

var SOE=SOE||{};SOE.MediaModal=(function(){'use strict';var NUM_DOTS=5;var _didInit=false;var _didInitYouTube=false;function updateDotPos(idx){var pos=idx+1;var dotCount=NUM_DOTS;$('#dotOverflowContainer .dot').removeClass('active').eq(idx).addClass('active');$('#dotOverflowContainer').stop().animate({'left':Math.ceil((pos/dotCount)-1)*-$('#paginationDotContainer').width()},function(){$('.modalControl').removeClass('disabled');});}
function init(){if(_didInit){return;}
_didInit=true;$('#media-modal').on('soe.updateDot',function(evt,dot){$('#media-modal-image').attr('src',$('#dotOverflowContainer .pagDot').eq(dot).data('img'));$('#mediaModalHeader .mediaNum').text(dot+1);updateDotPos(dot);});$('#media-modal').on('soe.arrowClick',function(evt,dir){var $allDots=$('#dotOverflowContainer .dot');var selectedDot=$allDots.index($('#dotOverflowContainer .dot.active'))+1;if(dir=='next'){if(selectedDot<$allDots.length){selectedDot++;}else{selectedDot=1;}}else{if(selectedDot>1){selectedDot--;}else{selectedDot=$allDots.length;}}
$('#media-modal-image').attr('src',$allDots.eq(selectedDot-1).parent().data('img'));$('#mediaModalHeader .mediaNum').text(selectedDot);updateDotPos(selectedDot-1);});$('#media-modal').on('click','.dot',function(){var idx=$(this).attr('rel')-1;$('#media-modal').trigger('soe.updateDot',idx);});$('#media-modal').keydown(function(key){if(key.which==37){$('#media-modal').trigger('soe.arrowClick','prev');}else if(key.which==39){$('#media-modal').trigger('soe.arrowClick','next');}});$('.modalTraverse').on('click',function(){$('#media-modal').trigger('soe.arrowClick',$(this).attr('rel'));});$('#media-modal').on('mouseenter','.pagDot',function(){var _this=$(this);var idx=_this.attr('rel')-1;var dotWidth=parseInt(_this.outerWidth(true),10)/2;var dotLeft=_this.offset().left;var tooltip=$('#paginationImages');if(!tooltip.hasClass('hidden')){var tooltipWidth=parseInt(tooltip.outerWidth(),10)/2;tooltip.stop().animate({left:(dotLeft+dotWidth)-tooltipWidth},'fast');$('#paginationImgSlider').stop().animate({'left':idx*-parseInt(tooltip.width(),10)},'fast');tooltip.show();}});$('#media-modal').on('mouseleave','.pagDot',function(){$('#paginationImages').hide();});$('.pagNavBtn').on('click',function(){var _this=$(this);var dotContainer=$('#dotOverflowContainer');var pageContainer=$('#paginationDotContainer');var pageWidth=pageContainer.width();var pages=(Math.ceil(dotContainer.children('.pagDot').length/NUM_DOTS)-1);var nextShift;var maxContainerShift=(pages*-pageWidth);if(_this.attr('rel')=='next'){nextShift=parseInt(dotContainer.css('left'))-pageWidth;if(nextShift<maxContainerShift){dotContainer.stop().animate({'left':0});}else{dotContainer.stop().animate({'left':nextShift});}}else{nextShift=parseInt(dotContainer.css('left'))+pageWidth;if(nextShift>0){dotContainer.stop().animate({'left':maxContainerShift});}else{dotContainer.stop().animate({'left':nextShift});}}});}
function initYouTube(){var youTubeAPI,firstScriptTag,youTubePlayer;if(_didInitYouTube){return;}
_didInitYouTube=true;youTubeAPI=document.createElement('script');youTubeAPI.src='//www.youtube.com/iframe_api';firstScriptTag=document.getElementsByTagName('script')[0];firstScriptTag.parentNode.insertBefore(youTubeAPI,firstScriptTag);$(document).on('show.bs.modal','#media-modal.video-content',function(){youTubePlayer=new YT.Player($('#media-modal .modal-video-replace').get(0),{width:'100%',height:'100%',playerVars:{'autoplay':1,'theme':'dark','color':'black','rel':0,'wmode':'opaque'},videoId:$(this).data('youtube-video-id')});});$(document).on('hide.bs.modal','#media-modal.video-content',function(){youTubePlayer.stopVideo();$('#media-modal .modal-video').html('<div class="modal-video-replace"></div>');});}
function setupGroup(options){var defaults={container:null,typeName:null,hidePaginationThumbs:false,containY:false,centerY:false};var _options=$.extend({},defaults,options);init();$(_options.container).on('click','a',function(e){e.preventDefault();var i,dotElement;var $allItems=$(_options.container).find('a');var selectedItemIdx=$allItems.index($(this));var targetImage=$(this).attr('href');var dotTemplate=_.template($('#tpl-pagination-dot').html());var dotContainerWidth=$('#paginationDotContainer').width();$('#mediaModalHeader .mediaType').text(_options.typeName.toUpperCase());$('#mediaModalHeader .mediaNum').text(selectedItemIdx+1);$('#mediaModalHeader .mediaTotal').text('/'+$allItems.length);$('#media-modal-image').attr('src',targetImage);$('#media-modal .filter').hide();$('#dotOverflowContainer').empty().width(9999999).css('left',(Math.ceil((selectedItemIdx+1)/NUM_DOTS)-1)*-dotContainerWidth);$('#paginationImgSlider').empty();$('#paginationImages').toggleClass('hidden',_options.hidePaginationThumbs);for(i=0;i<$allItems.length;i++){dotElement=$(dotTemplate({'pos':i+1}));dotElement.data('img',$allItems.eq(i).attr('href'));$('#dotOverflowContainer').append(dotElement);if(!_options.hidePaginationThumbs){$('#paginationImgSlider').width(9999999).append('<img src="'+$allItems.eq(i).find('img').attr('src')+'"/>');}}
$('#dotOverflowContainer .dot').eq(selectedItemIdx).addClass('active');$('#media-modal').toggleClass('contain-y',_options.containY);$('#media-modal').toggleClass('center-y',_options.centerY);$('#media-modal').removeClass('video-content');$('#media-modal').addClass('image-content');$('#media-modal').modal();e.preventDefault();});}
function setupPoster(options){var defaults={linkSelector:null};var _options=$.extend({},defaults,options);init();$(_options.linkSelector).on('click',function(event){event.preventDefault();$('#media-modal-image').attr('src',$(this).attr('href'));$('#media-modal').addClass('full-scroll image-content');$('#media-modal').modal();});}
function setupYouTube(options){var videoID;var defaults={linkSelector:null,defaultVideoID:null};var _options=$.extend({},defaults,options);initYouTube();$(_options.linkSelector).on('click',function(event){if($(window).width()>=768){event.preventDefault();var idSniff=/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i;videoID=$(this).attr('href').match(idSniff)[1]||_options.defaultVideoID;$('#media-modal').data('youtube-video-id',videoID);$('#media-modal').removeClass('image-content');$('#media-modal').addClass('video-content');$('#media-modal').modal();}});}
return{setupGroup:setupGroup,setupYouTube:setupYouTube,setupPoster:setupPoster};})();

/* end /web-platform/scripts/web-platform/component/media-modal.js*/

/* start /scripts/_pages/expansion-content.js*/

var scrollTo=function(hash){var top=(hash)?$('#'+hash).offset().top:0;$('html, body').animate({'scrollTop':top},500);}
var currency="USD";var shopModal=function(){var $prompt;var items,tmplt;var $tempContainer;function displayError(message){$("#messagePromptModal").modal({opacity:60,close:true,onOpen:function(dialog){dialog.overlay.fadeIn('fast',function(){dialog.container.slideDown('fast',function(){dialog.data.fadeIn('slow');$tempContainer=$("<div>").attr("id","promptContainer");tmplt=shopInGameProduct.template[message.type];items=[message];$prompt=$("#promptContainer");$tempContainer.append(_.template(tmplt,{item:items[0]}));$prompt.replaceWith($tempContainer);});});},onClose:function(dialog){dialog.data.fadeOut('fast',function(){dialog.container.slideUp('fast',function(){dialog.overlay.fadeOut('fast',function(){subtract();$.modal.close();});});});}});}
function subtract(){$prompt.html("");}
return{show:displayError};}();var currencyMenu=function(){var _currencyDropdown;var _currencySelector;var _currencyOptions;var _savedCurrency;function add(){_currencyDropdown=$('.currency_menu');_currencySelector=_currencyDropdown.find('.label > span');_currencyOptions=_currencyDropdown.find('.currency_dropdown').find('li');_currencyArrow='<div class="arrow"><span></span></div>';if(wpCookie("shop-currency")){_currencySelector.html($('a.'+wpCookie("shop-currency")).html()+_currencyArrow);}
_currencyOptions.on('click',function(evt){currency=evt.target.className;_currencySelector.html($(this).text()+_currencyArrow);shopDLC.update(currency);wpCookie("shop-currency",currency,30);});}
return{on:add};}();var dlc=function(){function add(){currencyMenu.on();}
return{on:add};}();$(document).ready(function(){var catagory='game';$('ul.site-nav li.'+catagory+'-nav').addClass('active');SOE.MediaModal.setupGroup({container:".expansion-screenshots",typeName:"Screenshots",hidePaginationThumbs:true});var parametersDLC={"theme":"eq","pageElementId":"dlcTemplateContainer","gameCode":"EQ","highlight":12,"uramRootUrl":globs.urls.uramRootUrl,"productCode":"dlc","setCurrency":currency,"locale":"en_US","trim":20};shopDLC=new Shop(parametersDLC);shopDLC.oldRenderDLC=shopDLC.displayDLCPricing;shopDLC.displayDLCPricing=function(){shopDLC.oldRenderDLC();if(itemList[0]){var template=_.template($('#st-grid-price').html());var markup=template(itemList[2]);$('#st-price-container').html(markup);var template2=_.template($('#standard-button').html())
var markup2=template2(itemList[2]);$('#standard-button-container').html(markup2);}
if(itemList[1]){var template=_.template($('#ce-grid-price').html());var markup=template(itemList[1]);$('#ce-price-container').html(markup);var template2=_.template($('#collector-button').html())
var markup2=template2(itemList[1]);$('#collector-button-container').html(markup2);}}
shopDLC.render();dlc.on();});

/* end /scripts/_pages/expansion-content.js*/

/* start /web-platform/scripts/web-platform/component/global-nav.js*/

(function(){var nonMember=_.template($("script.non-member").html());var member=_.template($("script.member").html());if(globs.wdl.userLoggedIn==true){$.ajax({url:'/get-rest-ticket',type:'POST',data:{type:0},context:this,success:function(sid){$.ajax({url:globs.urls.uramAjaxUrl+"/rest/commerce/11/allaccessinfo.action",dataType:"json",data:{'responseType':"json",'sessionID':sid.successPayload.ticket,},success:function(data){var memberData={scGrantDate:data.scGrantDate,scGrantClaimed:data.scGrantClaimed,mbExpirationDate:data.expirationDate};$('#mb-scBalance').text(data.scBalance);if(data.akella==false){if(data.member==false){$('#mb-all-access').html(nonMember());$('#mb-isMember').text('Try');}else{$('#mb-all-access').html(member(memberData));$('#mb-isMember').text('My');$("#membershipLink").click(function(){window.location.href=globs.urls.membershipMembership;});};}}})}})}else{$('#mb-all-access').html(nonMember());}})();

/* end /web-platform/scripts/web-platform/component/global-nav.js*/
